<?php

/**
 * Flags form.
 *
 * @package    explications_informatiques
 * @subpackage form
 * @author     Guimezanes Cyrille
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class FlagsForm extends BaseFlagsForm
{
  public function configure()
  {
	  	$this->disableLocalCSRFProtection(); 
	  //$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
  }
  public function setup()
  {
    $this->setWidgets(array(
      'idflags'     => new sfWidgetFormInputHidden(),
      'id_revision' => new sfWidgetFormInputHidden(),
      'id_flag'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Defsflags'), 'add_empty' => true)),
	  'id_asso'     => new sfWidgetFormInputHidden(),
    ));

    $this->setValidators(array(
      'idflags'     => new sfValidatorChoice(array('choices' => array($this->getObject()->get('idflags')), 'empty_value' => $this->getObject()->get('idflags'), 'required' => false)),
      'id_revision' => new sfValidatorString(),
	  'id_asso'     => new sfValidatorString(),
      'id_flag'     => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Defsflags'), 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('flags[%s]');
	$this->widgetSchema->setLabels(array(
    
	  'id_flag'		   => "Flag",
    ));
	$this->widgetSchema->setHelps(array(

	  'id_flag'		   => "Choissiez l'un des flags à appliquer",

    ));
    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

  }
  
}
